package com.kaifamiao.month04.day22;


import java.util.Arrays;
import java.util.Map;
import java.util.TreeMap;

public class Trinity {

    public static int trinity(int n) {
        boolean[] arr = new boolean[n];
        Arrays.fill(arr, true);
        int isCount = n;
        int count = 0;
        int i = 0;
        while (isCount > 1) {
            if (arr[i]) {
                count++;
                if (count == 3) {
                    count = 0;
                    arr[i] = false;
                    isCount--;
                }
            }
            i++;
            if (i == n) {
                i = 0;
            }
        }
        for (int j = 0; j < arr.length; j++) {
            if (arr[j]) {
                return j + 1;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
//        System.out.println(trinity(3));

        Map<String,String> map = Map.ofEntries();
        TreeMap<String,String> treeMap = new TreeMap<>(map);
//        float value = new Float("123");

    }
}
